<extend name="Base/member"/>

<block name="body">
  <div class="user-box shop">
    <h3 class="title">
      分销店铺 <small>申请开店</small>
    </h3>
    <if condition="empty($shop)">
      <p class="alert alert-info">提交您的资质信息，{:C('WEB_SITE_TITLE')}会与您联系哦！</p>
    <elseif condition="$shop['status'] == 0"/>
      <p class="alert alert-success">您的申请提交成功，等待审核！审核过程中{:C('WEB_SITE_TITLE')}会与您电话联系！</p>
    <elseif condition="$shop['status'] == -1"/>
      <p class="alert alert-danger">抱歉提交的资质，不符合我们对分销代理的要求，你可以修改资料重新申请！</p>
    </if>
    
    <if condition="empty($shop) OR $shop['status'] eq -1">
      
    <form action="__SELF__" id="J_shop_add" class="col-xs-8 form-horizontal J_ajax-form" method="POST">
      <div class="form-group">
        <label for="inputName" class="col-xs-3 control-label">姓名：</label>
        <div class="col-xs-8">
          <input type="text" name="audit_data[name]" class="form-control" value="{$audit_data.name}" placeholder="请输入您的姓名">
        </div>
      </div>
      <div class="form-group">
        <label for="inputName" class="col-xs-3 control-label">手机：</label>
        <div class="col-xs-8">
          <input type="text" name="audit_data[mobile]" class="form-control" value="{$audit_data.mobile}" placeholder="请输入您的手机号">
        </div>
      </div>
      <div class="form-group">
        <label for="inputName" class="col-xs-3 control-label">电子邮箱：</label>
        <div class="col-xs-8">
          <input type="text" name="audit_data[email]" class="form-control" value="{$audit_data.email}" placeholder="请输入您的E-mail地址">
        </div>
      </div>
      <div class="form-group">
        <label for="inputName" class="col-xs-3 control-label">身份证号：</label>
        <div class="col-xs-8">
          <input type="text" name="audit_data[person_id]" class="form-control" value="{$audit_data.person_id}" placeholder="请输入您的身份证号">
        </div>
      </div>
      <div class="form-group">
        <label for="inputName" class="col-xs-3 control-label">地区：</label>
        <div class="col-xs-8">
          <span id="J_area" class="select-box"></span>
        </div>
      </div>
      <div class="form-group">
        <label for="inputIntro" class="col-xs-3 control-label">申请理由：</label>
        <div class="col-xs-8">
          <textarea name="audit_data[intro]" class="form-control" id="inputIntro" placeholder="请输入申请理由（至少10个字）">{$audit_data.intro}</textarea>
        </div>
      </div>
      <div class="form-group">
        <div class="col-xs-6 col-xs-offset-3">
          {$shop['status']==-1?'<input type="hidden" value="0" name="status">':''}
          <button type="submit" class="btn btn-large btn-positive">{$shop['status']==-1 ? '重新申请': '申请开店'}</button>
        </div>
      </div>
    </form>
      
    </if>
  </div>
</block>
<block name="script">
  <script>
    seajs.use('jquery.loadtype', function(loadtype){
      $('#J_area').loadtype({
        type: 'area',  //【商品分类】itemCategory | 【地区】area
        name1: 'audit_data[prov]',
        name2: 'audit_data[city]',
        name3: 'audit_data[area]',
        value1: '{$audit_data.prov}',
        value2: '{$audit_data.city}',
        value3: '{$audit_data.area}'
      });
    });
  </script>
</block>